use of const in c++ [closed]

Posted by prp on Stack Overflow See other posts from Stack Overflow or by prp
Published on 2011-01-16T13:45:08Z Indexed on 2011/01/16 13:53 UTC
Read the original article Hit count: 99

Filed under:
class X;
    class Y
    {
            public:
                    Y(const X & x){cout<<"In Y"<<endl;}
    };
    class X
    {
            public:
                    operator Y()const{cout<<"In X"<<endl;}
    };
    void fun(Y y)
    {     cout<<"In fun"<<endl; }
    int main()
    {     X x;
         fun(x);
    }

can any one throw some light on this c++ program ...please i am new to c++

© Stack Overflow or respective owner

Related posts about c++